using System;
using System.Collections.Generic;
using System.Text;
using Firestarter.DB.Schema.BO;
using FireStarterModeller.BO;
using Habanero.BO;
using Habanero.Faces.Base;
using Habanero.Faces.Win;

namespace Firestarter.DB.Schema.UI
{
    public class ModelModificationsControl : UserControlWin, IFormControl
    {
        private readonly IEditableGridControl _editableGridControl;

        public ModelModificationsControl()
        {
            IControlFactory factory = GlobalUIRegistry.ControlFactory;
            _editableGridControl = factory.CreateEditableGridControl();
            _editableGridControl.Buttons.Visible = false;
            _editableGridControl.FilterControl.Visible = false;
            //GridInitialiser gridInitialiser = new GridInitialiser(_editableGridControl, factory);
            BorderLayoutManager borderLayoutManager = factory.CreateBorderLayoutManager(this);
            borderLayoutManager.AddControl(_editableGridControl, BorderLayoutManager.Position.Centre);
        }

        public BusinessObjectCollection<ModelModification> ModelModifications
        {
            get { return (BusinessObjectCollection<ModelModification>) _editableGridControl.Grid.BusinessObjectCollection; }
            set { _editableGridControl.BusinessObjectCollection = value; }
        }

        public IEditableGridControl EditableGridControl
        {
            get { return _editableGridControl; }
        }
        
        public void SetForm(IFormHabanero form)
        {
        }
    }
}
